// 行程压缩
#include <stdio.h>
#include <string.h>

int main() {
    char s[10010];
    scanf("%s", s);
    int l = strlen(s);
    char last = s[0];
    int c = 0;
    for (int i=0; i<l+1; i++) {
        if (s[i] == last) {
            c++;
        } else {
            printf("(%c,%d)", last, c);
            last = s[i];
            c = 1;
        }
    }
    printf("\n");
    return 0;
}